package com.thz.friend.controller.user;

import com.thz.api.pojo.vo.UserQuestionResultVO;
import com.thz.common.core.controller.BaseController;
import com.thz.common.core.result.Result;
import com.thz.friend.pojo.user.dto.UserSubmitDTO;
import com.thz.friend.service.user.IUserQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description
 * @Author thz
 * @Date 2025/3/30
 */
@RestController
@RequestMapping("/user/question")
public class UserQuestionController extends BaseController {

    @Autowired
    private IUserQuestionService userQuestionService;

    @PostMapping("/submit")
    public Result<UserQuestionResultVO> submit(@RequestBody UserSubmitDTO submitDTO) {
        return userQuestionService.submit(submitDTO);
    }

    @PostMapping("/rabbit/submit")
    public Result rabbitSubmit(@RequestBody UserSubmitDTO submitDTO) {
        return ToResult(userQuestionService.rabbitSubmit(submitDTO));
    }

    @GetMapping("/exe/result")
    public  Result<UserQuestionResultVO> exeResult(Long examId, Long questionId, String currentTime) {
        return Result.ok(userQuestionService.exeResult(examId, questionId, currentTime));
    }

}
